<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    
    //thien chi check commit ok
    //Quang check commit ok
    // thay doi
	protected function _initDb() {
		//Zend_Session::start(true);     
        $dbOption = $this->getOption('resources');
	    $dbOption = $dbOption['db'];
	    // Setup database
	    $db = Zend_Db::factory($dbOption['adapter'], $dbOption['params']);
	    $db->setFetchMode(Zend_Db::FETCH_BOTH);
	    $db->query("SET NAMES 'utf8'");
	    $db->query("SET CHARACTER SET 'utf8'");
	    Zend_Db_Table::setDefaultAdapter($db);
	    // Return it, so that it can be stored by the bootstrap
	    
	    return $db;
	}
	protected function _initRoutes(){
		$frontController = Zend_Controller_Front::getInstance();
		$router = new QSource_System_Route_Route();
		$frontController->setRouter($router->GetInitRoute());
	}
	protected function _initAutoload()
	{
		$autoloader = new Zend_Application_Module_Autoloader(array(
			'namespace' => '',
			'basePath'  => APPLICATION_PATH
		));
		return $autoloader;
	}
	protected function _initControllerFront(){
		$acl = new QSource_System_Controller_AclList();
		$fc = Zend_Controller_Front::getInstance();
		$fc->registerPlugin(new QSource_System_Controller_Permission($acl));
	}
}